using System;
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
using Voodoo.Pattern;
using Voodoo.Sauce.Core;

public class Preloader : SingletonMB<Preloader>
{
	public static Action OnComplete;

	public Animator LoadingAnim;

	private AsyncOperation loadMainSceneOperation;

	private bool VSInit_OK;

	public string NextScene;

	public string DuelScene;

	public static ABTestConfig ABTestConfig = new ABTestConfig();

	public static ShopConfig ShopConfig = new ShopConfig();

	public static CameraConfig CameraConfig = new CameraConfig();

	public static HouseLevelConfig HouseLevelConfig = new HouseLevelConfig();

	public static OptimizationConfig OptimizationConfig = new OptimizationConfig();

	public static BonusLevelConfig BonusLevelConfig = new BonusLevelConfig();

	public static TapControlConfig TapControlConfig = new TapControlConfig();

	public static WallGemsConfig WallGemsConfig = new WallGemsConfig();

	public static OnboardingConfig OnboardingConfig = new OnboardingConfig();

	public static FSSoonerConfig FSSoonerConfig = new FSSoonerConfig();

	public static CityBuilderConfig CityBuilderConfig = new CityBuilderConfig();

	public static CityBuilderBalanceConfig CityBuilderBalanceConfig = new CityBuilderBalanceConfig();

	public static DuelFightModeConfig DuelFightModeConfig = new DuelFightModeConfig();

	public static EnvironmentConfig EnvironmentConfig = new EnvironmentConfig();

	public static LotteryRVConfig LotteryRVConfig = new LotteryRVConfig();

	public static StartingPositionConfig StartingPositionConfig = new StartingPositionConfig();

	public static MinecraftLevelConfig MinecraftLevelConfig = new MinecraftLevelConfig();

	public static RailDigging RailDigging = new RailDigging();

	public static ShowLevelAtBeginning ShowLevelAtBeginning = new ShowLevelAtBeginning();

	public static StartRVConfig StartRVConfig = new StartRVConfig();

	public static MouthpiecesGameplay MouthpiecesGameplay = new MouthpiecesGameplay();

	public static Transition Transition = new Transition();

	public static DrawYourOwnLevel DrawYourOwnLevel = new DrawYourOwnLevel();

	public static ChestRoomConfig ChestRoomConfig = new ChestRoomConfig();

	public static EnhancedIncremental EnhancedIncremental = new EnhancedIncremental();

	public static GemIAP GemIAP = new GemIAP();

	public static BetterNoAds BetterNoAds = new BetterNoAds();

	public static BetterUpgradeScaling BetterUpgradeScaling = new BetterUpgradeScaling();

	public static DifferentHeads DifferentHeads = new DifferentHeads();

	public static BetterWinScreen BetterWinScreen = new BetterWinScreen();

	public static ExcavationMode ExcavationMode = new ExcavationMode();

	public static FlyingBonusLevel FlyingBonusLevel = new FlyingBonusLevel();

	public static NewGamePlus NewGamePlus = new NewGamePlus();

	public static RenewableEnergyBooster RenewableEnergyBooster = new RenewableEnergyBooster();

	public static UIRetake UIRetake = new UIRetake();

	public static SkinsByRV SkinsByRV = new SkinsByRV();

	private void Start()
	{
		LoadingAnim.SetBool("Exit", value: false);
		if (Transition.IsEnabled)
		{
			StartCoroutine(LoadNextScene("GamePlay_Transition"));
		}
		else
		{
			StartCoroutine(LoadNextScene(NextScene));
		}
	}

	private IEnumerator LoadNextScene(string name)
	{
		Debug.Log("LOAD SCENE");
		yield return null;
		_ = Time.unscaledTime;
		SceneManager.LoadScene(name);
		OnComplete?.Invoke();
	}

	private void AllowMainSceneToStart(VoodooSauceInitCallbackResult callback)
	{
		InitializeABTest();
		VSInit_OK = true;
	}

	private void InitializeABTest()
	{
	}
}
